package com.yx.sql.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 监测分析 文件类配置 属性
 *
 * @author kai.yang
 * @date 2023/3/30 15:11
 */
@Configuration
@Data
@RefreshScope
public class Conf {
    /**
     * 上传路径
     */
    @Value("${sgcc.file.upload.path:}")
    private String uploadPath;

    /**
     * 默认的文件名最大长度 100
     */
    @Value("${sgcc.file.upload.name.max.length:}")
    private String uploadMaxNameLength;

    /**
     * 上传文件后缀限制
     */
    @Value("${sgcc.file.upload.extension:}")
    private String[] uploadExtension;

    @PostConstruct
    public void init(){
        ConfConstants.uploadPath = this.uploadPath;
        ConfConstants.uploadNameMaxLength = this.uploadMaxNameLength;
        ConfConstants.uploadExtension = this.uploadExtension;
    }

}
